import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
Vue.use(VueRouter);

const routes: RouteConfig[] = [
  {
    path: "/",
    name: "Home",
    component: () => import("../views/Home.vue"),
    children: [
      {
        path: "/home",
        component: () => import("../views/homepage/index.vue")
      },
      {
        path: "/listpage",
        component: () => import("../views/homepage/userList.vue")
      },
      {
        path: "/",
        component: () => import("../views/homepage/shake.vue")
      },
      {
        path: "/chat",
        component: () => import("../views/homepage/chat.vue")
      },
      {
        path: "/musicList",
        name: "musicList",
        component: () => import("../views/homepage/musicList.vue")
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login.vue")
  }
];

const router = new VueRouter({
  //mode: 'history',
  base: process.env.BASE_URL,
  routes
});

export default router;
